package com.hpeu_01.day0114;

import java.time.LocalTime;

public class LocalTimeDemo {
    public static void main(String[] args) {
        //now():创建时间对象
        LocalTime localTime = LocalTime.now();
        System.out.println(localTime);
        //of():根据指定的时间创建对象
        LocalTime localTime1 = LocalTime.of(14, 12, 32);
        System.out.println(localTime1);
        //获取小时getHour()
        int hour = localTime.getHour();
        // 获取分钟getMinute()
        int minute = localTime.getMinute();
        // 获取秒钟getSecond()
        int second = localTime.getSecond();
        System.out.println(hour+":"+minute+":"+second);


    }
}
